<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
    <link rel="stylesheet" href="../../../javascript/plug-ins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="../../../css/style.css" />		
    <style>
     .dialog{width: 80% !important; top: 50%;}
     .img_box{padding:0px 10px;position: relative;}
     .img_title{position: relative;height: 30px;bottom: 30px;background: rgba(51,51,51,0.4);color: #fff;line-height: 30px;}
     
    
    </style>
<script src="../../../javascript/jquery.js"></script>
<script type="text/javascript" src="../../../javascript/plug-ins/layui/layui.js"></script>	
<script type="text/javascript" src="../../../javascript/plug-ins/pagination.js" ></script>
<script src="../../../javascript/laydate/laydate.js"></script>

     <script type="text/javascript" src="js/share.js"></script>

	</head>
	<body>
	   <div class="page-wrap">		
		
		<section class="page-hd t">         
         <header>
			<h5 class="title">
			 <a href="bigwheel.html" class="red">分享设置</a>
			 <!--<a href="that_set.html">说明设置</a>
			 <a href="notice_set.html">通知设置</a>
			 <a href="entrance_set.html">入口设置</a>-->
			</h5>	
		 </header>
		 <hr>
		</section>
		
		
		<div class="panel panel-default">
		  
		  <div class="form-content">
		  	
		  	<form>
		  	<div class="form-group-col-2">
		  	 	<div class="form-label">分享标题:</div>
		  	 	<div class="form-cont">
		  	 		<input type="text" class="form-control float_left form-boxed width50" id="title_share" placeholder="请输入分享标题" />
		  	 	</div>
		  	 </div>	

		  	 
		  	  <div class="form-group-col-2">
		  	 	<div class="form-label">分享图片:</div>
		  	 	<div class="form-cont">
		  	 		<input type="text" class="form-control float_left form-boxed width50" id="share_url" placeholder="请输入活动详情页背景图" />
		  	 		<div class="width10 text-center float_left border_gray"><img src="../../../img/nopic.png" id="img_info" height="31px"/></div>
					<form style="display:none" action="" method="post" enctype="multipart/form-data">
					　　<input type="file" style="display:none" name="file" class="image1" id="image1" value="">
					</form>
		  	 		<input type="button" onclick="getElementById('image1').click();" class="btn img_serch" value="请选择图片" />
		  	 	</div>
		  	  </div>	
		  	 
		  	 <div class="form-group-col-2">
		  	 	<div class="form-label">分享内容:</div>
		  	 	<div class="form-cont">
		  	 		<textarea type="text" class="form-control float_left form-boxed width50" id="share_concent" placeholder="请输入分享内容" ></textarea>
		  	 	</div>
		  	 </div>	
             
             <div class="form-group-col-2">
		 			<div class="form-label">新用户优惠券：</div>
		 			<div class="form-cont">
			          		              
		              <div class="add_rules" id="rules_new"><input type="button" class="btn btn-info add_rulesbtn margin_buttom10" value="+新增优惠券类型" /></div>
		 			</div><!--form-cont--->
		 		</div><!--form-group-col-2---->
		 		
		 		
		 	 <div class="form-group-col-2">
		 			<div class="form-label">老用户优惠券：</div>
		 			<div class="form-cont">
			         		              
		              <div class="add_rules" id="rules_old"><input type="button" class="btn btn-info add_rulesbtn margin_buttom10" value="+新增优惠券类型" /></div>
		 			</div><!--form-cont--->
		 		</div><!--form-group-col-2---->	
		  	 
		  	<div class="form-group-col-2">
		  	 	<div class="form-label">优惠券有效期:</div>
		  	 	<div class="form-cont">
		  	 		<input id="card_end_time" placeholder="请输入天数" />天
		  	 	</div>
		  	 </div>	

		  	 <div class="form-group-col-2">
		  	 	<div class="form-label"></div>
		  	 	<div class="form-cont">
                    <input type="button" value="提交" onclick="submit_share_config()" class="btn btn-info" />
		  	 	</div>
		  	 </div>	


		  	</form>
		  			  	
		  </div><!---form-content---->

		</div><!---panel--->
			
	   </div><!---page-wrap------>		
		
		
	<!--<div class="mask"></div>
    <div class="dialog">
	<div class="dialog-hd">
		<strong class="lt-title">本地图片</strong>
		<a class="rt-operate icon-remove JclosePanel" title="关闭"></a>
	</div>
	<div class="dialog-bd" style="height: 500px;overflow: scroll;">
		<form style="display:none" action="" method="post" enctype="multipart/form-data">
		　　<input type="file" name="file" class="image1" id="image1" value="">
		</form>
		<div class="flex flex-wrap margin_buttom10">
			<input type="button" onclick="getElementById('image1').click();" value="上传图片" class="btn btn-info margin_left10" />
		</div>
		
		<div class="flex flex-wrap flex-col-5" >
			<div class="box-child">
				 <div class="img_box">
					<img width="100%" height="170px" src="../../../img/invitation.png"/>
					<div class="img_title text-center">好看的图片.png</div>
				 </div>	
			</div>
			
			

		</div>
		
		
	</div>
	<div class="dialog-ft">
		<button class="btn btn-info JyesBtn">确认</button>
		<button class="btn btn-secondary JnoBtn">关闭</button>
	</div>-->
    </div>

		
	</body>
	<script>
	$('[name="file"]').change(function(){
		var files = $("#image1").get(0).files;
		var data = new FormData();
		data.append('file', files[0]);
		var MyTest = document.getElementById("image1").files[0];
		var reader = new FileReader();
		reader.readAsDataURL(MyTest);
		reader.onload = function(theFile) {
		　 var image = new Image();
		   image.src = theFile.target.result;
		   image.onload = function() {
				$.ajax({
					type:"POST",
					url : "../../../../../UploadServlet?serialtype=img_active",
					data: data,
					cache: false,
					dataType : "json",
					processData: false,
					contentType: false,
					success : function(datas, file, result) {
						$("#share_url").val(datas.data[0].src);
						$("#img_info").attr("src","/img_active/"+datas.data[0].src);
					},error:function(){
						alert("==error==");
					}
				});	
			}
		}
	});

	</script>
	  <script> 
       
       
        var rule='<div class="rules margin_buttom10 display_table">'+		              	
		                '<div class="float_left">'+
		                '<span class="margin_right10">优惠券类型</span>'+
							'<select class="width30 card_info">'+select_all_card(0)+'</select>'+	
		                '<span class="margin_right10"> ,可以获得金额</span><input type="text" class="form-control form-boxed width20 money_set" /><span></span>'+	
		                '</div>'+	
		                '<div class="float_left padding6 bg_red" onclick="icon_remove(this)"><i class="icon-remove"></i></div>'+	
		              '</div>';
    
    $(".add_rules").click(function(){
    	$(this).after(rule);
    	
    });
    
    function icon_remove(r){
    	$(r).parent().remove();
    }
    
    
       $('.img_serch').click(function(){
		$(".mask").show();
		$(".dialog").show();
		
	   });
  </script> 	
	
</html>
